Learn R Programming

Momocs (version 0.1-03)

Calibration: harm.quant: Calculate harmonic effect.

Description

Provide facilities for choosing the number of harmonics to retain in elliptical Fourier analysis.

Usage

harm.quant(Coo, id = 1:Coo@coo.nb, smooth.it = 0, harm.range= seq(8, 32, 6),
           scale = FALSE, center = TRUE, align = FALSE,
           plot = TRUE, legend = TRUE, palette = col.summer, lineat.y=c(1, 5, 10))

harm.qual(Coo, id = 1, smooth.it = 0, harm.range= c(1, 2, 4, 8, 16, 32),
           scale = FALSE, center = TRUE, align = FALSE, method = c("stack", "panel")[1],
		   legend = TRUE,
           palette = col.summer, shp.col="#70809033", shp.border="#708090EE")		   

harm.pow(Coo, id=1:Coo@coo.nb, probs=c(0, 0.5, 1), nb.h = 24,
           drop   = 1, smooth.it = 0, plot = TRUE, 
           legend = TRUE, title="Fourier power spectrum",
           lineat.x=seq(0, nb.h, by=6), lineat.y=c(0.9, 0.99), bw=0.1)

Arguments

Coo
The Coo object
id
integer. The id of the shape to display. A range of ids can be passed to harm.pow
probs
A vector of numeric, to define quantiles to calculate ; see quantile
smooth.it
integer. The number of smoothing iteration to perform.
harm.range
A vector of integer giving the harmonic range to calculate. See nb.h for harm.pow.
nb.h
integer. The maximal number of harmonics to calculate.
scale
logical. Whether to scale or not the shape.
center
logical. Whether to center or not the shape.
align
logical. Whether to align or not the shape.
plot
logical. Whether to plot or not the shape. If FALSE, only the results are returned.
method
A plotting method for harm.qual. If "stack" outlines are plotted on the same same, if "panel", separate reconstructions are plotted.
legend
logical. Whether to display a legend box.
title
character. The title to add.
drop
logical. Whether to drop the first harmonic for plotting and power calculation.
palette
A color palette such those included in Momocs or produced with colorRampPalette.
shp.col
A color for the shape body.
shp.border
A color for the shape border.
lineat.x
A vector of numeric to specify where to plot dashed lines on the x-axis.
lineat.y
A vector of numeric to specify where to plot dashed lines on the y-axis.
bw
numeric. The width of horizontal segments drawn for each harmonic.

Value

  • harm.quant returns a matrix containing deviations for each harmonic and corresponding quantiles. harm.pow returns a matrix containing cumulated harmonic power for each harmonic.

Details

So far, these methods can only be used for elliptical Fourier analysis, not for tangent angle or radius variation pespectives. They will be included in further versions. harm.quant is based on euclidean distance between original and reconstructed outlines harm.pow returns and plot cumulated harmonic power. The power of a given harmonic $n$ is calculated as follows: $$HarmonicPower_n= \frac{A^2_n+B^2_n+C^2_n+D^2_n}{2}$$

Examples

Run this code
data(bot)
harm.quant(bot)
harm.qual(bot)
harm.pow(bot)

Run the code above in your browser using DataLab